<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page language="java" import="com.server.web.JsVersionUtil"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>角色管理</title>
		<link rel="stylesheet" href='<c:url value="/share/pintuer.css"></c:url>'>
		<link rel="stylesheet" href='<c:url value="/share/admin.css"></c:url>' >
		<script type="text/javascript" src='<c:url value="/js/jquery.js"></c:url>' ></script>
		<script type="text/javascript" src='<c:url value="/js/pintuer.js"></c:url>'></script>
		<script type="text/javascript" src='<c:url value="/js/admin.js"></c:url>'></script>
		<script type="text/javascript" src='<c:url value="/js/layer.js"></c:url>'></script>
	</head>

	<body>
	<!--内容-->
	<div class="layout">
		<form method="post">
	    <div class="panel admin-panel">
	    	<div class="panel-head"><strong>角色列表</strong></div>
	        <div class="padding border-bottom">
	            <a class="button button-small border-green" href="<c:url value='/adminRole/addRole'></c:url>" >添加角色</a>
	        </div>
	        <table class="table table-hover">
	        	<tr><th width="20%">角色名id</th><th>角色名称</th><th>角色描述</th><th>操作</th></tr>
	        	<c:forEach items="${list}" var="a">
	        	<tr>
		        	<td>${a.id}</td>
		        	<td>${a.name}</td>
		        	<td>${a.description}</td>
		        	<td>
		        	<c:if test="${a.ident !='SYS_MANAGER'}">
		        	<a class="button border-blue button-little" href="<c:url value='/adminRole/updateRole?id=${a.id}'></c:url>">修改</a>
		        	</c:if>
		        	<c:if test="${empty a.ident}">
					<a class="button border-yellow button-little" onclick="{if(confirm('确认删除?')){return true;}return false;}" href="<c:url value='/adminRole/deleteRole?id=${a.id}'></c:url>">删除</a>
					</c:if>
		        	</td>
	        	</tr>
	        	</c:forEach>
	        </table>
	    </div>
	    </form>
	    </div>
		<!--底部-->
		<script>
			$(function() {
				
				//大于移动端800宽度才弹出提示
				if ($(window).width() >= 800) {
					layer.open({
						type: 1,
						shade: false,
						title: false, //不显示标题
						area: ['420px', '640px'],
						content: $('#alert-talk'), //捕获的元素
						cancel: function(index) {
							layer.close(index);
						}
					});
				}
			});
		</script>
	</body>

</html>